package cn.tedu.controller;

import cn.tedu.pojo.Car;
import cn.tedu.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
@RestController//接收请求
@RequestMapping("car")
public class CarController {
    //想要调用service的功能
    @Autowired
    private CarService carService;

    //获取所有数据
    @RequestMapping("get")
    public List<Car> get(){
        return carService.gettest();
    }
    @RequestMapping("getid")
    public Car getselect(Integer id){
      return carService.getId(id);
    }


}
